﻿using System;
using System.Windows.Media;
using Caliburn.Micro;
using Microsoft.Phone.Shell;
using Wulong.Phone.Dianping.i18n;

namespace Wulong.Phone.Dianping.Views
{
    public partial class MerchantsByChannelView
    {
        public MerchantsByChannelView()
        {
            InitializeComponent();
            LoadAppBar();
        }

        private void LoadAppBar()
        {
            // Set the page's ApplicationBar to a new instance of ApplicationBar
            ApplicationBar = new ApplicationBar();

            var searchButton = new AppBarButton
            {
                IconUri = new Uri("/Images/Appbar.Search.png", UriKind.Relative),
                Text = AppResources.Btn_Search,
                Message = "Search"
            };

            ApplicationBar.Buttons.Add(searchButton);

            var aboutMenuItem = new AppBarMenuItem
            {
                Text = AppResources.App_About,
                Message = "GoToAboutPage"
            };
            ApplicationBar.MenuItems.Add(aboutMenuItem);

            ApplicationBar.IsVisible = true;
            ApplicationBar.Mode = ApplicationBarMode.Minimized;
            ApplicationBar.Opacity = 0.85;
            ApplicationBar.BackgroundColor = Colors.Black;
        }
    }
}